﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/JAFagus.Master" Theme="Default" AutoEventWireup="true" CodeBehind="TinTucChuDe.aspx.cs" Inherits="Indeco.G24.Website.News.Admin.TinTucChuDe" %>
<%@ Register Src="~/UserControls/MenuNewsAdmin.ascx" TagName="Menu" TagPrefix="G24" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolderMain">
<script type="text/javascript">
function AddNew(key,index)
{    
    grid.AddNewRow();
}
function Edit(key,index)
{    
    grid.StartEditRow(index);
}
function Delete(key,index)
{ 
    if(confirm('Bạn muốn xóa bản ghi này ?'))         
    {   
        grid.DeleteRow(index);
    }
}
</script>
<asp:Panel ID="grid" runat="server" Height="100%" Width="100%" >
<div style="width:919px;padding:2,2,2,2;">
<div style="float:left;width:190px;margin-left:7px;" >  
   <G24:Menu ID="menu1" runat="server" />    
</div>
<div style="float:left;width:715px;padding-left:2px;">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
        <td class="tdBCTopLeft"></td>
        <td class="tdBCTopCenter"></td>
        <td class="tdBCTopRight"></td>
        </tr>
        <tr>
        <td class="tdBCMiddleLeft"><div class="tdBCMiddleLeft" style="visibility:hidden"></div></td>
        <td class="tdBCMiddleCenter">
	        <div class="divBCMiddleCenterHeader" >
                <div class="divBCMiddleCenterHeaderTitle" >                 
                    <span class="span-blockTitle"><asp:HyperLink ID="HyperLink2" ForeColor="#FFFFFF" CssClass="span-blockTitleTxt" runat="server">Qunar lý tin tức chủ đề</asp:HyperLink></span>
                </div>
            </div>
            <div class="divBCMiddleCenterContent" style="width:705px;">
               <dxwgv:ASPxGridView ID="ASPxGridView2" ClientInstanceName="grid" runat="server"
          DataSourceID="TinTucChuDeDataSource" KeyFieldName="IDTinTucChuDe" 
          AutoGenerateColumns="False" Width="100%"  CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
          CssPostfix="BlackGlass" OnRowDeleting="ASPxGridView2_RowDeleting" 
          OnRowInserting="ASPxGridView2_RowInserting" 
          OnRowUpdating="ASPxGridView2_RowUpdating" >
          <Columns>         
            <dxwgv:GridViewDataColumn Name="Delete" VisibleIndex="5">
            <EditFormSettings VisibleIndex="1" CaptionLocation="None" Visible="False" ColumnSpan="2" />
            <DataItemTemplate>
            <a ID="A2" style="color:#3E6B96;text-decoration:none;" onclick="Edit('<%# Container.KeyValue.ToString()%>', '<%# Container.VisibleIndex.ToString()%>')" href="#">Edit</a>
            <a ID="A1" style="color:#3E6B96;text-decoration:none;" onclick="AddNew('<%# Container.KeyValue.ToString()%>', '<%# Container.VisibleIndex.ToString()%>')" href="#">New</a>
            <a ID="DeleteButton" style="color:#3E6B96;text-decoration:none;" onclick="Delete('<%# Container.KeyValue.ToString()%>', '<%# Container.VisibleIndex.ToString()%>')" href="#">Delete</a>
            
            </DataItemTemplate>
            </dxwgv:GridViewDataColumn>           
              <dxwgv:GridViewDataTextColumn FieldName="TenChuDe" VisibleIndex="0" Name="Ten">
                <EditFormSettings VisibleIndex="1" CaptionLocation="None" ColumnSpan="2" />
                 <EditItemTemplate>
                     <div id="divTen" align="left">
                      <div style="float:left;width:100px;">
                         Tên Chủ Đề   
                     </div>
                     <div style="float:left;">
                       <dxe:ASPxTextBox ID="Ten"  runat="server" Width="200px" Text='<%# Bind("TenChuDe") %>'>
                    </dxe:ASPxTextBox>
                     </div> 
                    </div>
                </EditItemTemplate>
             </dxwgv:GridViewDataTextColumn>              
              <dxwgv:GridViewDataDateColumn FieldName="ThoiDiemChinhSua"  VisibleIndex="1" Name="Thoi Diem Chinh Sua">
                <EditFormSettings VisibleIndex="6" Caption="Thoi Diem Chinh Sua"  Visible="False"/>
                <EditItemTemplate>
                     <div id="divTen" align="left">
                    <dxe:ASPxDateEdit ID="ThoiDiemChinhSua" Width="200px" runat="server" Value='<%# Bind("ThoiDiemChinhSua") %>'>
                    </dxe:ASPxDateEdit>
                    </div>
                </EditItemTemplate>
             </dxwgv:GridViewDataDateColumn>
              <dxwgv:GridViewDataDateColumn FieldName="ThoiDiemCapNhat" VisibleIndex="2" Name="Thoi Diem Cap Nhat">
                <EditFormSettings VisibleIndex="7" Caption="Thoi Diem Cap Nhat" Visible="False" />
                <EditItemTemplate>
                 <div id="divTen" align="left">
                <dxe:ASPxDateEdit ID="ThoiDiemCapNhat" Width="200px" runat="server" Value='<%# Bind("ThoiDiemCapNhat") %>'>
                    </dxe:ASPxDateEdit>
                 </div>
                </EditItemTemplate>
             </dxwgv:GridViewDataDateColumn>           
     </Columns>
    <Styles CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" CssPostfix="BlackGlass">
    <AlternatingRow Enabled="True"/>
        <Header ImageSpacing="5px" SortingImageSpacing="5px">
        </Header>
     </Styles> 
       <SettingsEditing PopupEditFormModal="True" Mode="EditForm"  /> 
         <Images ImageFolder="~/App_Themes/BlackGlass/{0}/">
         </Images>
    </dxwgv:ASPxGridView> 
                
            </div>
        </td>
        <td class="tdBCMiddleRight"><div class="tdBCMiddleRight" style="visibility:hidden"></div></td>
        </tr>
        <tr>
        <td class="tdBCBottomLeft"></td>
        <td class="tdBCBottomCenter"></td>
        <td class="tdBCBottomRight"></td>
        </tr>
    </table>

    <data:TinTucChuDeDataSource ID="TinTucChuDeDataSource" runat="server"
			SelectMethod="GetPaged"
			UpdateMethod="Update"
			InsertMethod="Insert"
			EnableTransaction="true"			
			EnablePaging="True"
			EnableSorting="True" >				
	</data:TinTucChuDeDataSource>  
</div>	 
</div>	
    </asp:Panel>
</asp:Content>


